package com.itheima.service;

import com.itheima.client.UserClient;
import com.itheima.mapper.OrderMapper;
import com.itheima.pojo.Order;
import com.itheima.pojo.User;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.PlatformTransactionManager;

@Service
public class OrderService {


    @Autowired
    private OrderMapper orderMapper;

    @Autowired
    private UserClient userClient;


    public Order orderQueryByid(long id) {
        Order order = orderMapper.orderquer(id);
        User user = userClient.findById(order.getUserId());
        order.setUser(user);
        return order;

    }


}
